package com.zjcode.cdcer.controller;

import com.chinatechstar.component.commons.supports.PageData;
import com.zjcode.cdcer.model.basic.JsonObj;
import com.zjcode.cdcer.service.CerDataScreenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @ClassName:CerDataScreenController
 * @功能：数据大屏
 **/
@RestController
@Slf4j
@RequestMapping("/v1/datascreen/")
public class CerDataScreenController {

    @Autowired
    private CerDataScreenService cerDataScreenService;

    /**
     * 获取数据大屏数据
     *
     * @return
     */
    @PostMapping("getDataScreen")
    public JsonObj getDataScreen(@RequestBody PageData pageData) {
        Map<String, Object> dataScreen = cerDataScreenService.getDataScreen(pageData);
        return JsonObj.success(dataScreen);
    }

    /**
     * 点击地图板块获取对应地区本月份的三癌总数
     */
    @PostMapping("getAreaCancerCount")
    public JsonObj getAreaCancerCount(@RequestBody PageData pageData) {
        Map<String, Object> areaCancerCount = cerDataScreenService.getAreaCancerCount(pageData);
        return JsonObj.success(areaCancerCount);
    }
}
